#include <unistd.h>

#include <string>
#include <stdexcept>

#include <glib.h>
#include <gtkmm.h>
#include <gtkmm/socket.h>

class editor_process_exception : public std::runtime_error
{
    public:
        editor_process_exception(const char* msg = 0) : runtime_error(msg) {}
};

class editor_process : public Gtk::Window
{
    public:
        editor_process(std::string url="") throw(editor_process_exception);
        virtual ~editor_process();

        void close();
        void raise();

        Gdk::NativeWindow id() { return _id; }
        std::string url() { return _url; }

    private:
        static void editor_closed(GPid pid, gint status, gpointer data);
        std::string _url;
        Gdk::NativeWindow _id;
        pid_t _pid;

};
